Skip to content

Imports

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import mplfinance as mpf
import matplotlib.dates as mdates
import datetime as dt

import plotly.graph_objects as go
import plotly.express as px
import plotly.io as pio
from plotly.subplots import make_subplots

pio.renderers.default = "notebook"
pio.templates.default = "plotly_dark"
import gc

np.random.seed(42)
import warnings

warnings.filterwarnings("ignore")
plt.rcParams["figure.figsize"] = [12, 8]

Topics cum Notes

L10

Inverted Yield Curve

An inverted yield curve is a situation in which short term interest rates, like overnight rates or three month rates, are above long term interest rates. Inverted yield curves have often heralded a recession.

three_m = pd.read_csv("Data/3M.csv", index_col="Date", parse_dates=True)
six_m = pd.read_csv("Data/6M.csv", index_col="Date", parse_dates=True)
ten_y = pd.read_csv("Data/10Y.csv", index_col="Date", parse_dates=True)
thirty_y = pd.read_csv("Data/30Y.csv", index_col="Date", parse_dates=True)

us_13_w = pd.read_csv("Data/US13W.csv", index_col="Date", parse_dates=True)
us_10_y = pd.read_csv("Data/US10Y.csv", index_col="Date", parse_dates=True)
us_5_y = pd.read_csv("Data/US5Y.csv", index_col="Date", parse_dates=True)
us_30_y = pd.read_csv("Data/US30Y.csv", index_col="Date", parse_dates=True)
fig = go.Figure()

fig.add_scatter(
    x=us_30_y.index,
    y=us_30_y["Close"],
    name="US 30 Year Treasury Yield",
    line=dict(color="red", width=1),
)

fig.add_scatter(
    x=us_10_y.index,
    y=us_10_y["Close"],
    name="US 10 Year Treasury Yield",
    line=dict(color="blue", width=1),
)

fig.add_scatter(
    x=us_5_y.index,
    y=us_5_y["Close"],
    name="US 5 Year Treasury Yield",
    line=dict(color="green", width=1),
)

# fig.add_scatter(
#     x=us_13_w.index,
#     y=us_13_w["Close"],
#     name="US 13 Week Treasury Yield",
#     line=dict(color="yellow", width=1),
# )

fig.update_layout(
    title="US Treasury Yield Curve",
    xaxis_title="Date",
    yaxis_title="Yield",
    font=dict(family="Courier New, monospace", size=18, color="#7f7f7f"),
)
fig.show()
x.observe(notebookContainer, {childList: true});

}}

// Listen for the clearing of the current output cell var outputEl = gd.closest('.output'); if (outputEl) {{ x.observe(outputEl, {childList: true}); }}

                    })                };                });            </script>

LIBOR-OIS Spread

The LIBOR-OIS spread represents the difference between an interest rate with some credit risk built-in and one that is virtually free of such hazards. Therefore, when the gap widens, it’s a good sign that the financial sector is on edge.

Mortgage

A mortgage is a type of loan used to purchase or maintain a home, land, or other types of real estate. The borrower agrees to pay the lender over time, typically in a series of regular payments that are divided into principal and interest. The property then serves as collateral to secure the loan.

Most traditional mortgages are fully-amortizing. This means that the regular payment amount will stay the same, but different proportions of principal vs. interest will be paid over the life of the loan with each payment. Typical mortgage terms are for 30 or 15 years.

We have it as a verb. To mortgage something, to mortgage your house means to offer it as collateral for a loan. So when you get a mortgage on your house, typically it is to buy the house, the bank lends you the money to buy the house, but if you stop paying on the mortgage, they can reclaim the house.

Underwater: The term underwater is used to describe a situation in which the value of a home is less than the amount of money owed on the mortgage. If you are underwater, you are in a negative equity situation.

Investment Vehicle

An investment vehicle is a product used by investors to gain positive returns. Investment vehicles can be low risk, such as certificates of deposit (CDs) or bonds, or they can carry a greater degree of risk, such as stocks, options, and futures.

Investment vehicles can be low risk, such as CDs or bonds, or high risk such as options and futures.

Commercial Real Estate

Commercial real estate (CRE) is property used exclusively for business-related purposes or to provide a work space rather than a living space, which would instead constitute residential real estate. Most often, commercial real estate is leased to tenants to conduct income-generating activities. This broad category of real estate can include everything from a single storefront to a huge shopping center.

Real Estate

Real estate is defined as the land and any permanent structures, like a home, or improvements attached to the land, whether natural or man-made.

Real estate is a form of real property. It differs from personal property, which is not permanently attached to the land, such as vehicles, boats, jewelry, furniture, and farm equipment.

Not everyone can invest in real state. You must be "wealthy enough" to do so. The reason is that real estate is a very illiquid asset. It is very hard to sell at a price that you want. So, if you are a wealthy person, you can afford to buy a house and hold it for a long time. If you are not wealthy, you cannot afford to buy a house and hold it for a long time. You need to be able to sell it quickly if you need to.

Real Estate Investment Trust (REIT)

Limited Partnership

Direct Participation Program (DPP)

m_15_us = pd.read_csv("Data/MORTGAGE15US.csv", index_col="DATE", parse_dates=True)
m_30_us = pd.read_csv("Data/MORTGAGE30US.csv", index_col="DATE", parse_dates=True)
fig = go.Figure()

fig.add_scatter(
    x=m_15_us.index,
    y=m_15_us["MORTGAGE15US"],
    name="15 Year Mortgage Rate",
    line=dict(color="red", width=1),
)

fig.add_scatter(
    x=m_30_us.index,
    y=m_30_us["MORTGAGE30US"],
    name="30 Year Mortgage Rate",
    line=dict(color="blue", width=1),
)

fig.update_layout(
    title="US Mortgage Rate",
    xaxis_title="Date",
    yaxis_title="Rate",
    font=dict(family="Courier New, monospace", size=18, color="#7f7f7f"),
)
fig.show()